package com.bw.mvvm.network.load;

public class HttpFactory {
    private static HttpInterface token,sign,tokenSign,upload;

    public static HttpInterface create(HttpEnum httpEnum){
        switch (httpEnum){
            case Upload:
                if (upload == null){
                    upload = new UpLoadImpl();
                }
                return upload;
            case Token:
                if (token == null){
                    token = new TokenImpl();
                }
                return token;

            case TokenSign:
                if (tokenSign == null){
                    tokenSign = new TokeSignImpl();
                }
                return tokenSign;

            default:
                if (sign == null){
                    sign = new SignImpl();
                }
                return sign;
        }
    }
}
